package com.guigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备类型表（支持多级分类，管理平台所有二手机械类型）
 * </p>
 *
 * @author Xiaosong
 * @since 2025-10-09
 */
@Data
@TableName("equipment_type")
public class EquipmentType implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 设备类型唯一标识（主键）
     */
    @TableId(value = "type_id", type = IdType.AUTO)
    private Long typeId;

    /**
     * 类型名称（唯一，如"工程机械"、"履带挖掘机"）
     */
    private String typeName;

    /**
     * 父类型ID（关联本表type_id，顶级类型该值为NULL）
     */
    private Long parentId;

    /**
     * 类型编码（唯一，用于快速识别，如"GCJX-001"，GCJX=工程机械）
     */
    private String typeCode;

    /**
     * 类型描述（说明该类型设备的用途、范围，如"用于土方挖掘的履带式机械"）
     */
    private String typeDesc;

    /**
     * 排序号（控制类型在前端下拉/列表中的展示顺序，值越小越靠前）
     */
    private Integer sort;

    /**
     * 类型状态（0-禁用，1-启用；禁用后该类型不可用于新发布设备）
     */
    private Boolean status;

    /**
     * 记录创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public String getTypeDesc() {
        return typeDesc;
    }

    public void setTypeDesc(String typeDesc) {
        this.typeDesc = typeDesc;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "EquipmentType{" +
            "typeId = " + typeId +
            ", typeName = " + typeName +
            ", parentId = " + parentId +
            ", typeCode = " + typeCode +
            ", typeDesc = " + typeDesc +
            ", sort = " + sort +
            ", status = " + status +
            ", createTime = " + createTime +
            ", updateTime = " + updateTime +
        "}";
    }
}
